<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>JavaScript unit test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="../lib/prototype.js" type="text/javascript"></script>
  <script src="../lib/unittest.js" type="text/javascript"></script>
  <script src="../src/should_receive.js" type="text/javascript"></script>

  <script src="../src/utilities.js" type="text/javascript"></script>
  
  <script src="../src/bindings.js" type="text/javascript"></script>
  <link rel="stylesheet" href="../lib/unittest.css" type="text/css" />
  
</head>
<body>
<div id="testlog"></div>
<table id="data">
  <tbody id="data_body"></tbody>
</table>
<div id="foo"></div>
<script type="text/javascript">
// <![CDATA[
 
  Test.context("Bindings", {
    setup: function() {
      $('data_body').innerHTML = ''
    },
    teardown: function() {
      // Event.stopObservingAllSelectors()
    },
    "should be able to create accessors functions on any object": function() {
      Binding.makeAccessor($('data_body'), 'innerHTML')
      $('data_body').setInnerHTML('foofoofoo')
      $('data_body').getInnerHTML().shouldEqual('foofoofoo')
      $('data_body').innerHTML.shouldEqual('foofoofoo')
    },
    "should be able to bind one attribute to another": function() {
      Foo = {}; Bar = {};
      
      Binding.makeAccessor(Foo, 'here');
      Binding.makeAccessor(Bar, 'there');
      
      Binding.bind(Foo,'here', Bar, 'there')

      Bar.setThere('beep')
      // Foo.getHere().shouldEqual('beep')
      
      // Foo.setHere('buzz')
      // Bar.getThere().shouldEqual('buzz')
      
      
    }
    
  })
// ]]>
</script>

</script>
</body>
</html>